*****************************************************************************************************************************************************
* PROJECT: 		Exposure to the COVID-19 Stock Market Crash and its Effect on Household Expectations
* DATE: 		Nov 2020
* CONTENT: 		FIGURES
* AUTHORS: 		Tobin Hanspal, Johannes Wohlfart, Anni Weber
*****************************************************************************************************************************************************

		clear all
		set scheme lean2
		global pm = char(177)
		set more off
		gl date = c(current_date)
		graph set window fontface "cmr10"
		
		
* set cd as /Replication_files_HanspalWeberWohlfart2020/


*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~						
** FIGURE A2
*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~	

	import excel "data\other\FRED_joblessclaims_weekly_v2.xls", sheet("FRED Graph") firstrow clear 
	format date %td
	gen year=yofd(date)
	keep if year==2020

	gen week=week(date)
	keep week ICSA
	save temp\jobless_temp.dta, replace

	import excel "data\other\SP500_weekly.xlsx", sheet("SP500_weekly") firstrow clear 
	rename Date date
	format date %td
	gen year=yofd(date)
	keep if year==2020
	gen week=week(date)
	rename Close sp500_wkl
	destring sp500_wkl, replace
	duplicates drop
	bysort week: gen n=_n
	keep if n==1 
	drop n
	distinct week

	merge 1:1 week using temp\jobless_temp.dta

	label define week ///
		1 "Jan 6" 2 "Jan13" 3 "Jan 20" 4 "Jan 27"  5 "Feb 3" 6 "Feb 10" ///
		7 "Feb 17" 8 "Feb 24" 9 "Mar 2" 10 "Mar 9" 11 "Mar 16" 12 "Mar 23" ///
		13 "Mar 30" 14 "Apr 6" 15 "Apr 13"

	label values week week 

	label variable sp500_wkl "S&P 500"
	replace ICSA=ICSA/1000
	label variable ICSA "Initial jobless claims (000)"

 twoway (scatteri 8000 14 8000 15, bcolor(maroon*.5) recast(area)) ///
		(bar ICSA week , ///
		 xlabel(2 "Jan13"   5 "Feb 3" 8 "Feb 24" 11 "Mar 16" 14 "Apr 6" 17 "Apr 27" 20 "May 4" 23 "May 11", angle(45)) xtitle(""))  || ///
		(line sp500_wkl week, ///
		lwidth(medthick) yaxis(2) ylabel(, nogrid) color(maroon) lpattern(solid) legend(off) )  ,  ///
		ytitle("Initial jobless claims (000)", axis(1)) 

		graph export Figures\FigureA2.pdf, as(pdf) fontface("cmr10") replace
		graph export Figures\FigureA2.png, width(1600) replace	
		
	erase temp\jobless_temp.dta	
		